function GenerateTable(a_tableData)
{
    var table = "<table>";
    
    // Create the table header.
    table += GenerateTableHeader(a_tableData[0]);
    
    // Create the content.
    table += GenerateTableContent(a_tableData);
    
    // Create the end to the table and add it to the HTML.
    table += "</table>";
    document.getElementById("table").innerHTML=table;
}

function GenerateTableHeader(a_tableHeaderData)
{
    var header = "<tr class=\"even\">";
    
    for (i = 0; i < a_tableHeaderData.length; i++)
    {
        header += "<th>" + a_tableHeaderData[i] + "</th>";
    }
    
    header += "</tr>";
    
    return header;
}

function GenerateTableContent(a_tableData)
{
    var tableContent = "";
    
    for (row = 1; row < a_tableData.length; row++)
    {
        if (row % 2 == 0)
        {
            tableContent += "<tr class=\"even\">";
        }
        else
        {
            tableContent += "<tr>";
        }
        
        for (cell = 0; cell < a_tableData[row].length; cell++)
        {
            tableContent += "<td>" + a_tableData[row][cell] + "</td>";
        }
        
        tableContent += "</tr>";
    }
    
    return tableContent;
}
